import styled from 'styled-components'


export const RotateImage = styled.img.attrs(({theme, state}) => {
    return {
        theme, state
    }
})`
  animation: rotateAnimate 18.8s infinite linear;
  animation-play-state: ${props => props.state ? "paused" : "running"};
  @keyframes rotateAnimate {
    from {
      transform: rotateZ(0deg);
    }
    to {
      transform: rotateZ(360deg);
    }
  }
`

export const PlayControllerContainer = styled.div.attrs(({theme}) => theme)`
  position: fixed;
  width: 100%;
  height: 1.5rem;
  transition: height .3s ease-in-out;
  bottom: 0;
  color: ${(props) => props.textColor};
    //background-color: ${(props) => props.contentSecondaryBackgroundColor};
  background-color: rgba(0,0,0,.1);
  backdrop-filter: blur(15px);
  
  &.fullscreen {
    height: 100%;
    z-index: 2;
    .showPlay>.play-cover{
      opacity: 1;
    }
  }

  .showPlay {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    .play-name {
      font-size: .5rem;
      color: #fff;
      text-align: center;
      margin-top: .3rem;
    }

    .cover {
      filter: blur(6px);
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: .8;
      position: absolute;
      z-index: -1;
      top: 0;
      left: 0;
    }

    canvas {
      position: absolute;
      top: 0;
      left: 0;
    }

    .play-cover {
      width: 6rem;
      height: 6rem;
      display: block;
      margin: 1.5rem auto 0;
      border-radius: 50%;
      border: 8px solid #fff;
      opacity: 0;
      transition: opacity .3s ease;
      box-shadow: 0px 0px 12px #000111;
    }
  }


  .footer-player {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1.5rem;
    background-color: rgba(0, 0, 0, .3);
    backdrop-filter: blur(2px);
  }

  //歌曲进度条
  .play-range {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: .1rem;

    .thumb {
      width: .3rem;
      height: .3rem;
      background-color: ${props => props.activeBackgroundColor};
    }
  }
`
/**
 * @name Player
 * @description 真正的播放器容器！
 */
export const Player = styled.div.attrs(({theme}) => theme)`
  width: 80%;
  margin: auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  //封面
  .cover {
    width: 1rem;
    border-radius: 50%;
  }

  //控制图标
  .controller-icon {
    font-size: 0.625rem;
    color: #fff;
      //color: ${(props) => props.contentTextColor};
    /* color:#f0f0f0; */
  }

  @media screen and (max-width: 530px) {
    //小窗口 控制器百分百宽度 隐藏进度条和图标
    & {
      width: 100%;

      //.controller-icon.previous,
      //.controller-icon.next,
      //.controller-icon.transfer,
      //.controller-icon.play {
      //  display: none;
      //}

      .play-info {
        flex: 0;
      }

      .controller-icon.playList {
        font-size: 1rem;
      }
    }
  }
`